<?php
    
    App::import("Model","Config.BaseConfig");
    class BridgeConfig extends BaseConfig
    {
        var $name = "BridgeConfig";
        const COOKIE_NAME = "crowdvoxconnector";
        var $fieldProperties = array(
            "token" => array()
        );
        
        function generateToken()
        {
            $token = time().Utility::generateRandomCode(5);
            $token = md5($token);
            $this->create();
            $this->save(array($this->alias => array("token"=>$token)));
            return $token;
        }
    }
?>
